package com.ruoyi.framework.utils;

import com.ruoyi.common.constant.OpsConstants;
import com.ruoyi.framework.config.properties.AliossPropertis;
import net.dreamlu.mica.core.spring.SpringContextUtil;
import net.dreamlu.mica.redis.cache.CacheKey;

import java.time.Duration;

/**
 * @author dyun
 */
public class OssUtils {

    /**
     * oss缓存key
     */
    public static CacheKey getOssKey() {
        return new CacheKey(OpsConstants.ALIOSS_POLICY,
                Duration.ofMillis(SpringContextUtil.getBean(AliossPropertis.class).getExpireTime() * 1000));
    }
}
